/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package vue;

import java.awt.BorderLayout;
import java.util.Locale;
import java.util.ResourceBundle;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTable;
import javax.swing.border.Border;
import modele.TableModelPalmares;

/**
 * Vue qui affiche le palmares des meilleurs joueurs
 * @author Florian MININ & Khémon BEH
 */
public class VuePalmares extends JFrame{

    /*
     * Attributs 
     */
    private TableModelPalmares modele;
    private ResourceBundle bundle;

    /**
     * Constructeur
     * @param locale
     * @param _modele
     */
    public VuePalmares(Locale locale, TableModelPalmares _modele){

        modele = _modele;
        setLocale(locale);

        bundle = ResourceBundle.getBundle("international.international", locale);
        JPanel panelCentre = new JPanel();

        JTable jtablePalmares = new JTable();
        JScrollPane scrollPane = new JScrollPane();
        String[] nomColonnes = new String[]{bundle.getString("classement"), bundle.getString("nom"), bundle.getString("score")};
        modele.setNomsColonnes(nomColonnes);
        jtablePalmares.setModel(modele);
        scrollPane.setViewportView(jtablePalmares);
        panelCentre.add(scrollPane);

        setLayout(new BorderLayout());
        add(panelCentre, BorderLayout.CENTER);

        setTitle(bundle.getString("titre_palmares"));
        pack();
        setLocationRelativeTo(null);
    }

}
